﻿//Copyright (C) <2013>  <jonathan cleeve norton> All Rights Reserved 
//Contact jon.norton@fin-plus.co.uk website <http://www.fin-plus.co.uk/>
using System;
using FinPlusCompCore;
using System.Collections.Generic;
using QLNet;
using p = FinPlusCompQuant.QLConvParser;

namespace FinPlusCompQuant
{
    public class DefaultCurve : FinPlusComponent
    {
        //public List<DefaultProbabilityHelper> Instruments { get; private set; }
        //public DefaultEngine DefaultEngine { get; private set; }
        
        //construct
        public DefaultCurve(Market market, string name, string discountCurveName, DateTime settlementDate, string[] spreads, double recoveryRate, string dayCount, string holidays)
        {
            Id = name;
            var calendar = p.Calendar(holidays);
            var helpers = market.GetRateHelpers(spreads);

            //Instruments = new List<DefaultProbabilityHelper>();// TODO
            //std::vector<boost::shared_ptr<DefaultProbabilityHelper> > instruments;
		
            //for each(std::string s in spreadsVector)
            //{
            //    boost::shared_ptr<DefaultProbabilityHelper> spread = defaultHelpers[marketName][s];
            //    if(spread) instruments.push_back(spread);
            //}

            //defaultCurves[marketName][curveName] = boost::shared_ptr<PiecewiseDefaultCurve<HazardRate, BackwardFlat>>(new PiecewiseDefaultCurve<HazardRate, BackwardFlat>(settleDate, instruments, DayCount(dayCount)));

            //DefaultEngine(marketName, curveName, discountCurveName, recoveryRate);
        }
    }
}
